<?php
session_start();
include "session.php";
?>
<html>
<head>
<meta http-equiv="Content-Type" content="html/text; charset=utf-8" />
<title>所有用户</title>
</head>
<body>
<?php
  include "mysql.php";
  include "myfunction.php";
  $aa=new mysql;
  $aa->link("");
  $bb=new myfunction;
  $del_id=$_GET["del_id"];
  if($del_id!=""){
      $query="delete from user_info where id='$del_id'";
      if($aa->excu($query)){
              echo "<script language=javascript>alert('用户删除成功');</script>";
          }
  }
  $query="select * from user_info order by id";
       
    ?>
<br> <br> <br> <br> <br> <br> <br> <br>
    <table width="40%" border="0" align="center" cellspacing="0"  cellpadding="0" >
        <tr>
            <td height="20" align="left" ><?php $query2=$bb->page($query,$add,$page_id,10) ?></td>
        </tr>
    </table>
     <table width="40%" border="1" align="center" cellspacing="0"  cellpadding="0" >
        <tr>
            <td height="20" align="center" width="10%">序号</td>
            <td height="20" align="center" width="25%">用户名 </td>
            <td height="20" align="center" width="25%">注册时间</td>
             <td height="20" align="center" width="25%">最后登录时间</td>
              <td height="20" align="center" width="15%">操作</td>
        </tr>
     </table>
     <table width="40%" border="1" align="center" cellspacing="0"  cellpadding="0" >
        <?php
         
         $rst=$aa->excu($query2);
         $m=0;
         while ($user= mysql_fetch_array($rst)) {
                $m++;
      ?>
        <tr>
            <td height="20" align="center" width="10%"><?php echo $m; ?></td>
            <td height="20" align="center" width="25%"><?php echo $user["user_name"]; ?> </td>
            <td height="20" align="center" width="25%"><?php echo $user["time1"]; ?></td>
             <td height="20" align="center" width="25%"><?php echo $user["time2"]; ?></td>
             <td height="20" align="center" width="15%"><a href="?del_id=<?php echo $user[id]; ?>">删除</a></td>
        </tr>
        <?php } ?>
    </table>
</body>
</html>



